<template>
	<view class="widget-render">
	 <McTitle
      v-if="item.component == 'McTitle'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :attrs="item.attrs"
      :value="item.value"
    ></McTitle>

    <McImg
      v-if="item.component == 'McImg'"
      :id="'widget' + item.id"
      :key="item.id"
      :imageStyle="item.imageStyle"
      :imageValue="item.imageValue"
    ></McImg>

    <McSearch
      v-if="item.component == 'McSearch'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :value="item.value"
    ></McSearch>

    <McTab
      v-if="item.component == 'McTab'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :tabList="item.tabList"
      :attrs="item.attrs"
    ></McTab>

    <McCapCube
      v-if="item.component == 'McCapCube'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :cube="item.cube"
    ></McCapCube>

    <McCountdown
      v-if="item.component == 'McCountdown'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :value="item.value"
    ></McCountdown>

    <McGoods
      v-if="item.component == 'McGoods'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :attrs="item.attrs"
      :goodsData="item.goodsData"
      ref="mcGoods"
    ></McGoods>

    <Swiper
      v-if="item.component == 'McSwiper'"
      :id="'widget' + item.id"
      :key="item.id"
      :styles="item.styles"
      :attrs="item.attrs"
      :list="item.list"
    ></Swiper>

    <McNotice
      v-if="item.component == 'McNotice'"
      :id="'widget' + item.id"
      :key="item.id"
      :noticeStyles="item.noticeStyles"
      :noticeContent="item.noticeContent"
    ></McNotice>

	<NavBar
		v-if="item.component == 'NavBar'"
		:id="'widget' + item.id"
		:key="item.id"
		:item="item"
    :msgCount="msgCount"
    :location="location"
	>
	</NavBar>

	<WoTabs
		v-if="item.component == 'WoTabs'"
		:id="'widget' + item.id"
		:key="item.id"
		:item="item"
	>
	</WoTabs>

	<WoMaketCards
		v-if="item.component == 'WoMaketCards'"
		:id="'widget' + item.id"
		:key="item.id"
		:item="item"
	></WoMaketCards>
	</view>
</template>

<script>
  import McTitle from './widgets/McTitle/McTitle'
  import McImg from './widgets/McImg/McImg'
  import McSearch from './widgets/McSearch/McSearch'
  import McTab from './widgets/McTab/McTab'
  import McCapCube from './widgets/McCapCube/McCapCube'
  import McCountdown from './widgets/McCountdown/McCountdown'
  import McGoods from './widgets/McGoods/McGoods'
  import Swiper from './widgets/Swiper/Swiper'
  import McNotice from './widgets/McNotice/McNotice'
  import NavBar from './widgets/NavBar/index'
  import WoTabs from './widgets/WoTabs/index'
  import WoMaketCards from './widgets/WoMaketCards/index'

  export default {
    name: 'RenderWidget',
    props: {
      item: {
        type: Object,
        default: () => {},
      },
      location: {
				type: [Object, String],
        default: () => {}
      },
      msgCount: {
        type: Number,
        default: 0
      }
    },

    components: {
      McTitle,
      McImg,
      McSearch,
      McTab,
      McCapCube,
      McCountdown,
      McGoods,
      Swiper,
      McNotice,
      NavBar,
      WoTabs,
      WoMaketCards
    },

    methods: {
      getList () {
        this.$refs.mcGoods.getList()
      }
    }
  }
</script>

<style lang="scss" scoped>
.widget-render{

	}
</style>v
